The present invention relates to a data transfer system achieving a transfer of data having a variable length between a channel apparatus or unit and a storage medium apparatus such as a magnetic disk device, and in particular, to a data transfer system having a channel adapter capable of effecting an efficient data transfer also in a case where the length of a signal cable is elongated between the channel apparatus and the magnetic disk device.
In the JP-A-61-187057 filed on Sept. 18, 1985 with the priority based on the U.S. Ser. No. 700,355 filed by Fredericks et al. on Feb. 11, 1985 or in the "IBM Technical Disclosure Bulletin", Vol. 19, No. 8, January 1977, pp. 3139-3143, there has been proposed a channel adapter using an optical transfer technology in order to effect a data transfer through a long distance by elongating the length of a transfer cable between a channel apparatus and a magnetic disk device (a kind of peripheral storage device).
According to the system described in the literature cited above, between the channel apparatus or device and the magnetic disk device, there are disposed a channel adapter A on the channel device side and a channel adapter B and a magnetic disk controller on the magnetic disk side and these units are linked by use of signal cables. Particularly, the channel adapters A and B are connected to each other with an optical cable advantageous for a long-distance transmission because the signal attenuation and the effect of noise are considerably reduced as compared with the metal conductors. The channel adapters A and B are capable of effecting a conversion of a plurality of electric signals arranged in the parallel fashion into optical signals ordered in the bit serial manner so as to match the transmission format in the optical cable and vice versa. For the connecting cables between the channel adapter and the channel device as well as the magnetic disk controller, there can be employed a standard input interface described in the "IBM System/360 and System/370 Interface Channel to Control Unit Original Equipment Manufactures' Information".
In the system above, in order to write data having a variable length in a magnetic disk device, the data is transferred from the channel unit to the magnetic disk device as follows.
First, a write command, Channel Command Word (CCW) specifying the data length and data address of data to be transferred from the channel unit to the magnetic disk control unit is sent from the channel unit to the magnetic disk control unit. The magnetic disk unit then separately examines the track and sector position of the magnetic disk device in which the transferred data is to be written and the allowable data length thereof and then issues a request for the data via the channel adapters B and A to the channel unit. The magnetic disk controller, prior to a write operation of the data in the magnetic disk device, stores the data received from the channel unit in a temporary buffer memory for the following reason. In a case where there exists a very long connection length, for example, several hundred meters, between the channel unit and the magnetic disk controller, even if a data request is issued to the channel unit at a point of time when the recording head matches with the first recording position of the rotating magnetic disk, the data is not immediately transferred to the magnetic disk unit. There is a considerable delay of the response time that elapses from when the data request from the magnetic disk device reaches the channel unit and when data sent from the channel unit, after the request is decoded, arrives at the magnetic disk unit. As a consequence, during the period of the delay, since the magnetic disk is rotating, there arises an unused space on the track. In order to avoid the problem of the response delay time taking place in the long-distance transmission path, data with a capacity which can be written on the magnetic disk is transferred during the delay time of the transmission path from the channel device to the buffer memory of the magnetic disk controller so as to be temporarily stored therein. Since the magnetic disk controller is adjacent to the magnetic disk device or is located in a position relatively in the neighborhood of the magnetic disk device, the period of the signal transmission time therebetween is negligible, and hence when the magnetic disk issues a data transfer request to the magnetic disk controller, the data is almost instantaneously transferred therefrom to the magnetic disk device and is then recorded in a track of the disk.
However, in the system above, when the transmission route between the channel unit and the magnetic disk controller is elongated, the capacity of the buffer memory of the magnetic disk controller is naturally required to be increased. That is, in a system having different transmission routes, the capacity of the respective buffer memory varies; consequently, the compatibility of the magnetic disk units cannot be sustained, and a considerably great amount of buffer memory is necessary when the transmission route becomes long, which leads to a disadvantage with respect to system cost.
In order to solve the above problem, there has been proposed a system in which a buffer memory is also disposed in the channel adapter on the side of the magnetic disk controller. In this system, on receiving a write command CCW from the channel unit, the channel adapter B requests the channel unit to transfer data corresponding to the capacity of the data buffer without waiting for the data transfer request from the magnetic disk controller so as to store the data in the data buffer. When a transfer request from the magnetic disk controller is received, the channel adapter B transfers the data stored in the buffer memory thereof to the buffer memory of the magnetic disk controller. Each time the data is entirely outputted from the buffer memory, the channel adapter B issues a data transfer request to the channel unit thereby storing the data corresponding to the capacity of the data buffer memory. The signal path between the channel adapter B and the magnetic disk controller is short and the period of delay time associated with the response time to be elapsed from when the data transfer request from the magnetic disk controller is received to when the data is transferred is negligible.
In this system, the channel adapter B requests the channel unit to transfer data corresponding to the capacity of the buffer memory thereof. In consequence, when the data length requested by the magnetic disk device is smaller than that requested by the channel adapter B, the channel unit assumes the requested length to be an incorrect length and hence a software error is assumed so as to terminate the data transfer processing with an abnormal termination. In a case of a fixed data length, the capacity of the buffer memory of the channel adapter B need only be fixed to the predetermined data length; however, in a system in which variable-length data is to be transferred, it cannot be avoided that the abnormal termination disadvantageously takes place.